namespace Skymate.Commands
{
    using System.Collections.Generic;

    public static class LightColorHelper
    {
        public static IEnumerable<LightColor> CreateLightColors(
            byte value)
        {
            IList<LightColor> colors = new List<LightColor>();

            colors.Add((LightColor)(value >> 6));
            colors.Add((LightColor)((value & 0x30) >> 4));
            colors.Add((LightColor)((value & 0x0c) >> 2));
            colors.Add((LightColor)(value & 0x03));

            return colors;
        }

        public static byte CreateLightColorByte(
            LightColor color1,
            LightColor color2,
            LightColor color3,
            LightColor color4)
        {
            return (byte)(((byte)color1 << 6) | 
                          ((byte)color2 << 4) | 
                          ((byte)color3 << 2) | 
                          ((byte)color4));
        }

    }
}